<template>
  <div>
    <div id="pietab2" style="width: 640px;height: 315px;margin-top:10px"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts';

export default {
  data() {
    return {
      chartData: {
        series: [
          {
            data: [10, 20, 30, 40, 50],
          },
        ],
      },
      option: {
        backgroundColor: 'white',
        grid: {
          top: '0%',
          left: '0%',
          right: '0%',
          bottom: '0%',
          containLabel: true,
        },

        tooltip: {
          trigger: "axis",
        },
        xAxis: {
          data: ['03-08', '03-09', '03-10', '03-11', '03-12', '03-14', '03-15',],
          axisLine: {
            show: true,
            lineStyle: {
              color: '#E5E6EB',
            }
          },
          axisLabel: {
            color: '#86909C',
            fontSize: 12,
          },
        },
        yAxis: [{
          type: 'value',
          nameTextStyle: {
            color: "#000",
            fontSize: 14,
            padding: [0, 0, 0, 0]
          },
          axisLabel: {
            color: '#4E5969',
            fontSize: 12
          },
          splitLine: {     //网格线
            "show": false,
          }
        }],
        series: [
          {
            type: 'line',
            smooth: true,
            showSymbol: false,
            barWidth: 20,
            data: [90, 70, 98, 11, 22, 66, 77, 77],
            itemStyle: {
              normal: {
                color: "#801a6f",
                width: 2
              },
            },
          }
        ]
      }
    };
  },
  methods: {
    getAnnounceList() {
      this.loading = true;
      this.$ajax.post("/ststistic/hallststisticday").then((response) => {
        this.option.xAxis.data = response.data[0]
        this.option.series[0].data = response.data[1]
        let chartDom2 = document.getElementById('pietab2');
        let myChart2 = echarts.init(chartDom2);
        this.option && myChart2.setOption(this.option);

      });
    },
  },
  created() {
    this.getAnnounceList()
  },

};
</script>
